package com.TestDemo;

import java.util.Arrays;

public class TestString {
    public static void main(String[] args) {
        String ss = "12321";


        double value = Double.valueOf(ss.toString());
        double value2 = Double.valueOf(ss);
        String s1 = String.valueOf(value);
        System.out.println("s1:" + s1);

        char a = '由';
        String s = ""+a;
        System.out.println("char :" + s.length() + s.toString());
        Double aDouble = new Double(ss);

        System.out.println(ss.toString());
        System.out.println(value);     //same 12321.0
        System.out.println(value2);     //same 12321.0
        System.out.println(aDouble);     //same  12321.0


        String str1 = "12345789";

        Integer integer = new Integer(str1);
        System.out.println(integer);

        int i = Integer.valueOf(str1);
        System.out.println(i);

        String str2 = new String();
        str2.length();
        str2 = str2 + "555";
        System.out.println(str2.length());
        System.out.println(str2);

        String a1 = "s";
        String b1 ="s";
        System.out.println(a1 +"=="+b1+":"+a1==b1); //true
        String a2 = new String("s");
        String b2 = new String("s");
        System.out.println(a2 +"=="+b2+":"+a2==b2);

        String longString = "qwertrtytyuiuvdsd";
        char[] ch = longString.toCharArray();
        int chInt =    ch.length;
        System.out.println(longString + "   length: " + chInt);
        for(int i1 = 0;i1 < ch.length/2;i1++){
            char c1= ch[i1];
            ch[i1] = ch[ch.length-i1-1];
            ch[ch.length-i1-1] = c1;

        }

        for(Object obj:ch){
            System.out.print(obj+ "");
        }

        System.out.println();

        StringBuffer stringBuffer = new StringBuffer(longString);
        StringBuffer rev = stringBuffer.reverse();
        System.out.println(rev);


        String[]  strings = new String[14];
        strings[0]  = "aaaa";
        String s2 = new String();
        s2 = "aaaaa";

        System.out.println(Arrays.toString(strings));

    }
}
